<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改职称申报')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-professional-verify" th:object="${recordProfessional}">
            <input name="professionalId" th:field="*{professionalId}" type="hidden">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">申报类别：</label>
                        <div class="col-sm-8">
                            <select name="professionalType" class="form-control m-b" disabled th:with="type=${@dict.getType('professional_type')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{professionalType}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">申报年度：</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control time-input" data-type="year" disabled name="professionalYear" th:field="*{professionalYear}" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">申报职称：</label>
                        <div class="col-sm-8">
                            <select name="professionalName" class="form-control m-b" disabled th:with="type=${@dict.getType('professional_name')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{professionalName}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">申报职称等级：</label>
                        <div class="col-sm-8">
                            <select name="professionalLevel" class="form-control m-b" disabled th:with="type=${@dict.getType('basic_post_level')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{professionalLevel}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">申报方式：</label>
                        <div class="col-sm-8">
                            <select name="professionalWay" class="form-control m-b" disabled th:with="type=${@dict.getType('professional_way')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{professionalWay}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">现从事专业：</label>
                        <div class="col-sm-8">
                            <select name="majorType" class="form-control m-b" disabled th:with="type=${@dict.getType('major_type')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{majorType}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">评审依据学历：</label>
                        <div class="col-sm-8">
                            <select name="educateType" class="form-control m-b" disabled th:with="type=${@dict.getType('basic_educate_name')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{educateType}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">依据学历取得时间：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="educateTime" th:value="*{educateTime}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">所学专业：</label>
                        <div class="col-sm-8">
                            <input name="educateMajor" th:field="*{educateMajor}" class="form-control" type="text" disabled>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">专业年限：</label>
                        <div class="col-sm-8">
                            <input name="majorYear" th:field="*{majorYear}" class="form-control" type="text" disabled>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">继续教育是否合格：</label>
                        <div class="col-sm-8">
                            <select name="isPass" class="form-control m-b" disabled th:with="type=${@dict.getType('sys_yes_no')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isPass}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">是否一线员工：</label>
                        <div class="col-sm-8">
                            <select name="isFront" class="form-control m-b" disabled th:with="type=${@dict.getType('sys_yes_no')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isFront}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">是否担任过带教老师或教学秘书及时间：</label>
                        <div class="col-sm-8">
                            <select name="isTeacher" class="form-control m-b" disabled th:with="type=${@dict.getType('sys_yes_no')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isTeacher}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">是否参加过支农、第一村医等活动及时间：</label>
                        <div class="col-sm-8">
                            <select name="isFarmer" class="form-control m-b" disabled th:with="type=${@dict.getType('sys_yes_no')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isFarmer}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">继续教育及继续医学教育学分是否达到合格标准：</label>
                        <div class="col-sm-8">
                            <select name="isStandard" class="form-control m-b" disabled th:with="type=${@dict.getType('sys_yes_no')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isStandard}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">聘任现职务以来是否发生过医疗事故或投诉：</label>
                        <div class="col-sm-8">
                            <select name="isFailure" class="form-control m-b" disabled th:with="type=${@dict.getType('sys_yes_no')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isFailure}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">学术兼职：</label>
                        <div class="col-sm-8">
                            <input name="plurality" class="form-control" th:field="*{plurality}" type="text" disabled>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">备注：</label>
                        <div class="col-sm-8">
                            <input name="remark" class="form-control" th:field="*{remark}" type="text" disabled>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">审批结果：</label>
                        <div class="col-sm-8">
                            <div class="radio-box">
                                <input type="radio" id="verify-yes" name="verifyFlag" value="1">
                                <label for="verify-yes">通过</label>
                            </div>
                            <div class="radio-box">
                                <input type="radio" id="verify-no" name="verifyFlag" value="2">
                                <label for="verify-no">不通过</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">通过时间：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <input name="verifyTime" id="verifyTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label">审核意见：</label>
                        <div class="col-xs-10">
                            <input name="verifyRemark" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4">论文或著作（最多三项）</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table1"></table>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4">科研或专利（最多三项）</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table2"></table>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4">荣誉（最多三项）</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table3"></table>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "record/professional";
        $("#form-professional-verify").validate({
            focusCleanup: true
        });

        $(function() {
            initTable1();
            initTable2();
            initTable3();
        });

        function initTable1() {
            var options = {
                data: [[${recordProfessional.info1List}]],
                id: "bootstrap-table1",
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'index',
                        align: 'center',
                        title: "序号",
                        formatter: function (value, row, index) {
                            var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                            return columnIndex + $.table.serialNumber(index);
                        }
                    },
                    {
                        field: 'title',
                        align: 'center',
                        title: '名称'
                    },
                    {
                        field: 'position',
                        align: 'center',
                        title: '位次'
                    }]
            };
            $.table.init(options);
        }

        function initTable2() {
            var options = {
                data: [[${recordProfessional.info2List}]],
                id: "bootstrap-table2",
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'index',
                        align: 'center',
                        title: "序号",
                        formatter: function (value, row, index) {
                            var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                            return columnIndex + $.table.serialNumber(index);
                        }
                    },
                    {
                        field: 'title',
                        align: 'center',
                        title: '名称'
                    },
                    {
                        field: 'position',
                        align: 'center',
                        title: '位次'
                    }]
            };
            $.table.init(options);
        }

        function initTable3() {
            var options = {
                data: [[${recordProfessional.info3List}]],
                id: "bootstrap-table3",
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'index',
                        align: 'center',
                        title: "序号",
                        formatter: function (value, row, index) {
                            var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                            return columnIndex + $.table.serialNumber(index);
                        }
                    },
                    {
                        field: 'title',
                        align: 'center',
                        title: '名称'
                    }]
            };
            $.table.init(options);
        }

        function submitHandler() {
            var verifyFlag = $("input[name='verifyFlag']").val();
            var verifyTime = $("#verifyTime").val();
            if(verifyFlag == '1' && verifyTime == '') {
                $.modal.alertError("请选择审核时间");
                return;
            }
            if ($.validate.form()) {
                $.operate.save(prefix + "/verify/save", $('#form-professional-verify').serialize());
            }
        }
    </script>
</body>
</html>